<?php

/* Created by: Adam Malevski
 * Date: 2011-12-07
 * Class tests ask.class.php
 */

require_once '../ask.class.php';

$cat = new Ask(119);

echo "<h2>Test with existed asks</h1>";

// Tests get category ID
if ($cat->getId() == 119)
    echo "<p style='color:green;'>getId(): Test passed.</p>";
else
    echo "<p style='color:red;'>getId(): Test failed.</p>";

// Tests get Work Id
if ($cat->getWorkId() == 90)
    echo "<p style='color:green;'>getWorkId(): Test passed.</p>";
else
    echo "<p style='color:red;'>getWorkId(): Test failed.</p>";

// Tests get Asking User Id
if ($cat->getAskingUserId() == 2)
    echo "<p style='color:green;'>getAskingUserId(): Test passed.</p>";
else
    echo "<p style='color:red;'>getAskingUserId(): Test failed.</p>";

// Tests get Pleasing User Id
if ($cat->getPleasingUserId() == 1)
    echo "<p style='color:green;'>getPleasingUserId(): Test passed.</p>";
else
    echo "<p style='color:red;'>getPleasingUserId(): Test failed.</p>";

// Tests set ask work id
/*if ($cat->setWorkId(1))
    echo "<p style='color:green;'>setWorkId(): Test passed.</p>";
else
    echo "<p style='color:red;'>setWorkId(): Test failed.</p>";

    
// Tests updated get asks work id
if ($cat->getWorkId() == 1)
    echo "<p style='color:green;'>getWorkId(): Test passed.</p>";
else
    echo "<p style='color:red;'>getWorkId(): Test failed.</p>";


echo "<h2>Test with create ask</h1>";

$ncat = new Ask(NULL, 1, 1);
// Tests get category ID
if ($ncat->getId() == 24)
    echo "<p style='color:green;'>getId(): Test passed.</p>";
else
    echo "<p style='color:red;'>getId(): Test failed.</p>";

// Tests get Work Id
if ($ncat->getWorkId() == 1)
    echo "<p style='color:green;'>getWorkId(): Test passed.</p>";
else
    echo "<p style='color:red;'>getWorkId(): Test failed.</p>";

// Tests get Asking User Id
if ($ncat->getAskingUserId() == 2)
    echo "<p style='color:green;'>getAskingUserId(): Test passed.</p>";
else
    echo "<p style='color:red;'>getAskingUserId(): Test failed.</p>";

// Tests get Pleasing User Id
if ($ncat->getPleasingUserId() == 1)
    echo "<p style='color:green;'>getPleasingUserId(): Test passed.</p>";
else
    echo "<p style='color:red;'>getPleasingUserId(): Test failed.</p>";

 */ ?>
 
